//
//  BaseNavigationController.swift
//  SinaMicroBlog
//
//  Created by xinjuwen on 15/10/17.
//  Copyright © 2015年 xinjuwen. All rights reserved.
//

import UIKit

class BaseNavigationController: UINavigationController {
    
    /**
    自定义NavigationController构造函数
    
    - parameter image:          tabBar的图标
    - parameter selectedImage:  被选择后tabBar的图标
    - parameter rootController: 根控制器
    */
    init(image:String, selectedImage:String, rootController:UIViewController) {
        
        //设置NavigationController根控制器
        super.init(rootViewController: rootController)
        
        //设置在tabBar中的图标
        self.tabBarItem.image = UIImage(named: image)
        
        //设置在tabBar中被选择的图标
        self.tabBarItem.selectedImage = UIImage(named: selectedImage)?.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)

    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Do any additional setup after loading the view.
    }

}
